#include "Context.h"


EXPORT void Transform ( GLint index ){

	Context * context = getContext();
	
	MatrixMultiply(&(context->Matrix.ModelViewStack[context->Matrix.ModelViewStackPointer]),
					(Vect4D*)&(context->VertexArray.pointer[index]), 
					&(context->VertexArray.EyeCoord[index]));
													
	MatrixMultiply(&(context->Matrix.ProjectionStack[context->Matrix.ProjectionStackPointer]),
					&(context->VertexArray.EyeCoord[index]),
					&(context->VertexArray.ClipCoord[index]));
					
	PerspectiveDevise(&(context->VertexArray.ClipCoord[index]),
					  &(context->VertexArray.NDCoord[index]));
					  
	ViewportTransform( &(context->VertexArray.NDCoord[index]),
					   &(context->VertexArray.WindowCoord[index]));
					   
	
}
